package com.brillilab.service.core.method;

import com.brillilab.common.entity.PageVo;
import com.brillilab.domain.po.method.MethodRecommendAudit;
import com.brillilab.domain.vo.method.MethodAuditInfoVo;
import com.brillilab.domain.vo.method.MethodAuditListVo;
import com.brillilab.domain.vo.method.MethodAuditStateVo;

import java.util.List;
import java.util.Map;

public interface IMethodRecommendAuditService {
    /*********************************wuzhiyu**************************************/
    /**
    * @Description: 新增
    * @Params: [audit]
    * @return boolean
    * @author wuzhiyu
    * @date 2019/2/26 17:27
    */
    boolean add(MethodRecommendAudit audit);
/**
* @Description: TODO
* @Params: [labMemberId, auditId]
* @return com.brillilab.domain.po.method.MethodRecommendAudit
* @author wuzhiyu
* @date 2019/2/26 17:28 
*/
    MethodRecommendAudit getById(Long labMemberId, Long auditId);
/**
* @Description: state = null 为不区分状态
* @Params: [labMemberId, pageIndex, rows]
* @return com.brillilab.common.entity.PageVo<com.brillilab.domain.po.method.MethodRecommendAudit>
* @author wuzhiyu
* @date 2019/2/26 17:29
*/
    PageVo<MethodRecommendAudit> listPagedByRecommendMemberId(Long labMemberId, Integer pageIndex, Integer rows,Integer state);

    MethodRecommendAudit selectById(Long id);

    boolean saveList(List<MethodRecommendAudit> list);

    MethodRecommendAudit getByRecommendMethodId(Long labId,Long methodRecommendId);

    boolean deleteNotAudit(Long methodId);

    List<MethodRecommendAudit> getIsRecommendMethodAuditList(List<Long> recommendMethodIdList);

    MethodRecommendAudit getRecommendAuditByMethodId(Long methodId,Long labId);
    /*********************************黎剑*******************************************/
    /**
     * 分页获取推荐审核列表
     *
     * @param labId
     * @param firstTypeIds
     * @param pageNum
     * @param pageSize
     * @return
     */
    PageVo<MethodAuditListVo> getAuditList(Long labId, List<Long> firstTypeIds, Integer state, int pageNum, int pageSize);

    /**
     * 取消推荐/重新推荐
     *
     * @param id        推荐方法审核ID
     * @param operation 操作：0-取消推荐，1-重新推荐
     * @return
     */
    void operation(Long id, Integer operation);

    /**
     * 审核信息
     *
     * @param id 推荐方法审核ID
     * @return
     */
    MethodAuditInfoVo auditInfo(Long id);

    /**
     * 审核不通过
     *
     * @param id           推荐方法审核ID
     * @param auditOpinion 推荐方法审核ID
     * @return
     */
    void notAdopt(Long labId, Long auditorId, Long id, String auditOpinion);


    /**
     * 审核按钮时查询审核状态
     *
     * @param id 推荐方法审核ID
     * @return
     */
    MethodAuditStateVo auditState(Long id);
    
	int updateById(MethodRecommendAudit recommendAudit);
	
	/**
	 * 未处理条数
	 * @param labId
	 * @return
	 */
	int countUntreated(Long labId);
	
	/**
	 * 获取审核状态数量
	 * @param labId
	 * @return
	 */
	Map<String, Integer> getStateCount(Long labId);

	List<MethodRecommendAudit> selectByMethodIds(Long labId,List<Long> methodIds);
    /*********************************Wu Menghao*******************************************/
    /**
     * 通过labId,state查找
     * @param labId
     * @param state
     * @return
     */
    List<MethodRecommendAudit> selectByLabIdAndState(Long labId,Integer state);

    /**
     * 根据管理员Id获取前top条的推荐方法记录
     * @param top 前多少条记录
     * @param labId 实验室Id
     * @param state 审核状态0-等待审核,1-已推荐,2-审核未通过,3-取消推荐
     * @return
     */
    List<MethodRecommendAudit> getTopByLabIdAndState(Integer top,Long labId, Integer state);

    /**
     * 根据管理员Id获取推荐方法记录
     * @param labId 实验室Id
     * @param state 审核状态0-等待审核,1-已推荐,2-审核未通过,3-取消推荐
     * @return
     */
    List<MethodRecommendAudit> getByLabIdAndState(Long labId, Integer state);

    /**
     * 根据审核Id集合获取审核记录
     * @param auditIds
     * @return
     */
    List<MethodRecommendAudit> selectByIds(List<Long> auditIds);
}
